<template>
    <van-nav-bar class="aaa" @click-left="$myRouter.back()" left-arrow>
        <template #title v-if="center === 'qqq'">
            <van-search @click="$myRouter.push('/sousuo')" placeholder="请输入搜索关键词" />
        </template>
        <template #title v-if="center === 'www'">
            购物车
        </template>
        <template v-if="right ==='aaa'" #right>
        <button @click="$myRouter.push('/login')" class="dl">登录</button>
    </template>
    <template v-if="right ==='fff'" #right>
        <button class="ss">搜索</button>
    </template>
    <template v-if="right ==='sss'" #right>
        ···
    </template>
    </van-nav-bar>
</template>
<script name="jdTop" setup lang="ts">
import {useRouter} from 'vue-router'
const $myRouter = useRouter()
interface HomeInfo {
    right?:string,
    center?:string
}

defineProps<HomeInfo>()
</script>
<style scoped lang="scss">
.aaa{
    background-color: red;
}
.dl{
    background-color: red;
    border: 0px;
    color: white;
}
.van-search{
    // background-color: 
    margin: 0;
    padding: 0;
}
.ss{
    padding: 5px;
    background-color: red;
    border: none;
    color: white;
}
</style>